#ifndef DO_MQTT_H
#define DO_MQTT_H

#include "MQTTClient.h"
#include <stdint.h>

enum run_status_e
{
    CONN = 0,
    SUB,
    PUB_MESSAGE,
    KEEPALIVE,
    RECV,
    ERR = 255
};

typedef struct mqtt_conn_t
{
    char mqtt_host_url[1024];
    uint8_t server_ip[4];
    int port;
    char client_id[1024];
    char username[1024];
    char password[1024];
    char pub_topic[255];
    char pub_topic_reply[255];
    char sub_topic[255];
    char sub_topic_reply[255];
    enum QoS pub_qos;
    enum QoS sub_qos;
    char will_topic[255];
    enum QoS will_qos;
    char will_msg[255];
} mqtt_conn_t;

extern uint8_t g_flowing_light;
extern uint8_t g_rainbow_effect;
extern mqtt_conn_t g_mqtt_params;
extern uint8_t g_red_value;
extern uint8_t g_green_value;
extern uint8_t g_blue_value;
void mqtt_init(uint8_t sn, uint8_t *send_buf_ptr, uint8_t *recv_buf_ptr);
void do_mqtt(void);

#endif /* DO_MQTT_H */
